<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="theme-color" content="#33474d">
	<title>cacti增加客户端监控 | 失落的乐章</title>
	<link rel="stylesheet" href="/css/style.css" />
	
      <link rel="alternate" href="/atom.xml" title="失落的乐章" type="application/atom+xml">
    
</head>

<body>

	<header class="header">
		<nav class="header__nav">
			
				<a href="/archives" class="header__link">Archive</a>
			
				<a href="/tags" class="header__link">Tags</a>
			
				<a href="/atom.xml" class="header__link">RSS</a>
			
		</nav>
		<h1 class="header__title"><a href="/">失落的乐章</a></h1>
		<h2 class="header__subtitle">技术面前，永远都是学生。</h2>
	</header>

	<main>
		<article>
	
		<h1>cacti增加客户端监控</h1>
	
	<div class="article__infos">
		<span class="article__date">2017-10-12</span><br />
		
		
			<span class="article__tags">
			  	<a class="article__tag-link" href="/tags/Cacti/">Cacti</a>
			</span>
		
	</div>

	

	
		<h2 id="1-安装-snmp"><a href="#1-安装-snmp" class="headerlink" title="1.安装 snmp"></a>1.安装 snmp</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@lnmp ~]<span class="comment"># yum install -y net-snmp</span></div></pre></td></tr></table></figure>
<h2 id="2-修改-snmp-conf"><a href="#2-修改-snmp-conf" class="headerlink" title="2.修改 snmp.conf"></a>2.修改 snmp.conf</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@lnmp ~]<span class="comment"># vim /etc/snmp/snmpd.conf</span></div></pre></td></tr></table></figure>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;修改 syslocation 以及 syscontact ，其中 syslocation 可以写本机 ip，syscontact 写管理员邮箱。</p>
<p><figure class="figure"><img src="https://github.com/hcldirgit/image/blob/master/cacti%E5%A2%9E%E5%8A%A0%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%9B%91%E6%8E%A7/01.png?raw=true" alt=""></figure></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.启动 snmp</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">[root@lnmp ~]<span class="comment"># service snmpd start</span></div></pre></td></tr></table></figure>
<h2 id="4-cacti-增加监控"><a href="#4-cacti-增加监控" class="headerlink" title="4.cacti 增加监控"></a>4.cacti 增加监控</h2><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;登录 cacti 管理后台，点控制台，再点设备，在右上角点 “add” </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;描述： 写本机 ip 或自定义一个名字</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;主机名：hostname 写本机 ip</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;设备模版：选择 Net-SNMP Device </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;采集线程数：可以选择 2-5</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SNMP版本：改为 version 2</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;设置完成点右下角的创建，然后点右上角的 “Create Graphs for this Device”</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Graph Types:  选择SNMP - Interface Statistics </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在下面框中选择要监控的网卡，比如我选择eth0, 在最右侧小方块里打对勾，然后点右下角的create（如果在这一步找不到网卡，可以参考<a href="https://hcldirgit.github.io/2017/08/12/Cacti/5.%20cacti%E7%9B%91%E6%8E%A7%E6%89%BE%E5%88%B0%E7%BD%91%E5%8D%A1%E7%9A%84%E6%96%B9%E6%B3%95/" target="_blank" rel="external">cacti监控找到网卡的方法</a>）</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Graph Types:  再选择 Graph Template Based</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在下面的框中，选择你要监控的项目，比如ucd/net - Load Average </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在右侧小方块中打对勾，然后点右下角的创建</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;点击设备，选择新增加主机，选择  defaur tree 点 go</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;defaut tree 下面已经增加了添加的主机，图形一开始不会那么快出来，要等一会才可以</p>

	

	
		<span class="different-posts"><a href="/2017/10/12/Cacti/2. cacti增加客户端监控/" onclick="window.history.go(-1); return false;">⬅️ Go back </a></span>

	

</article>

	</main>

	<footer class="footer">
	<div class="footer-content">
		
	      <div class="footer__element">
	<p>Hi there, <br />welcome to my Blog glad you found it. Have a look around, will you?</p>
</div>

	    
	      <div class="footer__element">
	<h5>Check out</h5>
	<ul class="footer-links">
		<li class="footer-links__link"><a href="/archives">Archive</a></li>
		
		  <li class="footer-links__link"><a href="/atom.xml">RSS</a></li>
	    
		<li class="footer-links__link"><a href="/about">about page</a></li>
		<li class="footer-links__link"><a href="/tags">Tags</a></li>
		<li class="footer-links__link"><a href="/categories">Categories</a></li>
	</ul>
</div>

	    

		<div class="footer-credit">
			<span>© 2017 失落的乐章 | Powered by <a href="https://hexo.io/">Hexo</a> | Theme <a href="https://github.com/HoverBaum/meilidu-hexo">MeiliDu</a></span>
		</div>

	</div>


</footer>



</body>

</html>
